/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Objects;

import GameEngine.GameConstants.Effect;
import GameEngine.GameConstants.Graphic;
import GameEngine.GameConstants.Material;
import GameEngine.Vector;

/**
 *
 * @author maximusfowler
 */
public class Spike extends GameObject {


        /* constructor */
    public Spike(Vector dir, Vector cen, Vector s) {
        super(dir, cen, s, Graphic.SPIKE);
        material = Material.SPIKY;
    }

     /** this is the method by which other objects will effect this object. There will be a switch case
     * for each effect. For this abstract object, there will be a default implementation for each effect.
     * Specifiec objects will overwrite this method, but within them their default switch case will
     * be super.receiveEffect(), which will cause these default effects. */
    @Override
    public void receiveEffect(Effect e, Vector d, int power) {
         switch (e) {
             case TRANSMUTE:
                 GameObject newTrans = new Water(new Vector(direction), new Vector(center), new Vector(size));
                 lev.createObject(newTrans);
                 lev.destroyObject(this);
                 break;
             default:
                 // do nothing
                 break;
         }
    }

    /** this method will be called on both objects in a collision wherever the collision checker detects
     * a collision. By default this method will be made up of a switch case of Material, but particular
     * objects may have more interesting and nefarious collision behavior, including calling receiveEffect
     * on the object they collided with, causing an effect on their group, or causing an effect on themself.
     * @param o
     */
    @Override
    public void collide(GameObject o) {
         // nothing happens to a wall when it gets collided with
        }

}
